module.exports = app => {
    const { STRING, INTEGER, TEXT, DECIMAL, DATE } = app.Sequelize;
  
    const SupplierProductQuotation = app.model.define('supplier_product_quotation', {
      sid: {
        type: INTEGER,
        primaryKey: true,
        autoIncrement: true,
        comment: '主键ID'
      },
      stt: {
        type: STRING(20),
        comment: '序号'
      },
      supplier_code: {
        type: STRING(50),
        comment: '供应商代码'
      },
      supplier_name: {
        type: STRING(500),
        comment: '供应商名称'
      },
      tax_code: {
        type: STRING(100),
        comment: '税号'
      },
      store_name: {
        type: STRING(200),
        comment: '店铺名称'
      },
      supply_industry: {
        type: STRING(200),
        comment: '供应行业'
      },
      product_code: {
        type: STRING(100),
        comment: '产品代码'
      },
      product_name: {
        type: TEXT,
        comment: '产品名称'
      },
      specification: {
        type: TEXT,
        comment: '规格'
      },
      unit: {
        type: STRING(50),
        comment: '单位'
      },
      unit_price: {
        type: DECIMAL(15, 2),
        comment: '单价'
      },
      vat: {
        type: DECIMAL(5, 2),
        comment: '增值税率'
      },
      quotation_date: {
        type: DATE,
        comment: '报价日期'
      },
      create_time: {
        type: DATE,
        defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
        comment: '创建时间'
      },
      update_time: {
        type: DATE,
        defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
        comment: '更新时间'
      },
      modifier: {
        type: STRING(100),
        defaultValue: 'system',
        comment: '修改人'
      }
    }, {
      tableName: 'supplier_product_quotation',
      timestamps: false,
      comment: '供应商产品报价表'
    });
  
    return SupplierProductQuotation;
  };